<?php
get_header();
require(WEBTREATS_INCLUDES . "/var.php");

if ($custom_use_more_quicktag) { global $more; }
?>

<div id="body_block" <?php webtreats_body_class(); ?>>
	
	<?php if($home_slider_page) { webtreats_header_slider_switcher($homepage_slider); } ?>
	
	<?php webtreats_teaser_text($post->ID); ?>
	
<div id="body_block_background">
	<div class="inner">
							
<?php if (!$breadcrumb_disable){ if (class_exists('simple_breadcrumb')) { $bc = new simple_breadcrumb; }} ?>

	<div id="main">
		<div class="content">

<?php if($header_teaser == 'disable') : ?>
<h1>Search Results<br /> for: &lsquo;<?php the_search_query() ?>&rsquo;</h1>
<?php endif; ?>

<?php
$exclude_blog_cats = preg_replace("!(\d)+!","-${0}$0", $blog_excludecats);

$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
$s = get_query_var('s');
query_posts("s=$s&cat=$exclude_blog_cats&paged=$page");
?>

<?php if(have_posts()) : while(have_posts()) : the_post(); ?>

	<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
		<div class="blog_module">

			<?php webtreats_post_image(); ?>

			<h2 class="blog_header">
				<a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a>
				<span class="comment_bubble"><?php comments_popup_link('0', '1', '%'); ?></span>
			</h2>		

			<div class="entry">
				<?php
				if ($custom_use_more_quicktag) {
					$more = 0;
					the_content("Read More",false);
				}else{ 
					the_excerpt(); ?><a class="fancy_link read_more_link" href="<?php the_permalink(); ?>">Read More</a>
				<?php } ?>
			</div>

			<div class="blog_meta">
				<?php $get_year = get_the_time('Y'); $get_month = get_the_time('m'); ?>
				Posted on: <a href="<?php echo get_month_link($get_year, $get_month); ?>"><?php the_time('m-j-Y') ?></a><br />
				Posted in: <?php the_category(', ') ?>
			</div>

		</div><!-- blog_module -->
	</div><!-- post -->

<?php endwhile; ?>

<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>

<?php else : ?>

	<p>Sorry, no posts matched your criteria.</p>

<?php endif; ?>

<?php get_sidebar(); ?>
<?php get_footer(); ?>